import server from './myAxios/interceptors'
export const getUserList=(data)=>{
    return server.request({
        url:'users',
        method:'get',
        params:{...data}
    });
}
export const addUser=(data)=>{
    return server.request({
        url:'users',
        method:'post',
        data
    });
}
export const getUserId=(data)=>{
    return server.request({
        url:'users',
        method:'get',
        params:{...data}
    });
}
export const putUserState=(data)=>{
    return server.request({
        url:`users/${data.uId}/state/${data.type}`,
        method:'put',
    });
}
export const putEditUser=(data)=>{
    return server.request({
        url:`users/${data.id}`,
        method:'put',
        data:{
            email:data.email,
            mobile:data.mobile,
        }
    });
}
export const deleteUser=(data)=>{
    return server.request({
        url:`users/${data.id}`,
        method:'delete',
    });
}
export const putUserRole=(data)=>{
    return server.request({
        url:`users/${data.id}/role`,
        method:'put',
        data
    })
}
